A tool electrode made of copper or graphite for the electric discharge machine is juxtaposed with an electrically conductive workpiece, defining a clearance between the tool electrode and the workpiece, so-called "machining gap." The electric discharge machine is an apparatus that machines the workpiece by means of an electric discharge generated across the machining gap by intermittently applying voltage to this machining gap. The machining gap is filled with in a mineral-oil-based dielectric fluid or water-based dielectric fluid. On wire-cut electric discharge machines that use a traveling wire as a tool electrode, deionized water with a resistivity of 50,000 to 100,000 .OMEGA..multidot.cm is usually used. When the high voltage is applied to the machining gap, resistivity of the dielectric fluid is decreased across the machining gap. Then, an electric discharge occurs causing the flow of current through the machining gap and the voltage drop. The current flows during a controlled ON-time, vaporizing and melting material of the workpiece. This molten portion is then flown out of the machining gap by means of a flow of the dielectric fluid. The dielectric fluid restores insulating properties when the application of the voltage is interrupted during a controlled OFF-time. Thus, a number of crater-like small cavities are formed on the surface of the workpiece in succession, removing the material of the workpiece to be machined. The electric discharge machine is provided with a machining power supply and controller that can control ON time and OFF time of the voltage pulse, the magnitude of the electric discharge current and the polarity of the voltage pulse. Usually, the polarity in which the workpiece is positively poled and the tool electrode is negatively poled is called "straight polarity", the reverse polarity is called "reverse polarity."
During the delay time in which an electric discharge does not occur though the voltage is applied across the machining gap, electrolysis may sometimes occur in the presence of the water-based dielectric fluid due to the difference in voltage between the tool electrode and the workpiece. This electrolysis results in the decomposition of the workpiece material positively charged, causing rusting of ferrous material and oxidation of nonferrous material. This undesirable electrolysis occurs not only on the workpiece but also on the work table and power supply cables. To avoid this undesirable electrolysis, the machining power supply that can supply the voltage pulse of the "reverse polarity" and that of the "straight polarity" selectively to the machining gap so that neither the polarity of the tool electrode nor that of the workpiece may outweighs the other may be used.
A method of bringing the tool electrode into contact with the workpiece to precisely locate the workpiece securely mounted on a work table is well known. In order to employ this method, an electric discharge machine has a power supply which is connected to both the tool electrode and the workpiece for continuously applying voltage across the machining gap, and a contact detector which detects that the voltage potential between the tool electrode and the workpiece becomes 0 V. The power supply for the contact detection is considerably lower in output voltage and smaller in current capacity than the machining power supply. The power supply for the contact detection including an AC power source is known. Since the power supply for the contact detection and the machining power supply are connected in parallel to the machining gap, it is necessary to make a provision to prevent the power supply for the contact detection from being damaged during electric discharge machining. For example, an electromagnetic switch is used to detach the power supply for the contact detection from the machining gap during electric discharge machining. In this case, it must be taken into account that the electromagnetic switch should not be closed until the voltage charged in the machining gap during electric discharge machining has naturally discharged. If the electromagnetic switch is closed before the voltage charged in the machining gap has been naturally discharged, the circuit for the power supply for the contact detection gradually deteriorates, and eventually it may break down. Therefore, the electromagnetic switch is controlled by the timer circuit in which the maximum value of the time presumably required for this natural electric discharge is set.